﻿<%@ Page Language="C#" %>

<%@ Import Namespace="wojilu" %>
<%@ Import Namespace="wojilu.View" %>
<%@ Import Namespace="wojilu.Apps.Qycms.Domain" %>
<%@ Import Namespace="wojilu.Apps.Qycms.Service" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>#{softtitle}</title>
<link href="#{path.css}ybb/css/baselist.css?v=#{cssVersion}" rel="stylesheet" type="text/css" />
<link href="#{path.css}ybb/css/all.css?v=#{cssVersion}" rel="stylesheet" type="text/css" />
<link href="#{path.css}ybb/css/formdiv.css?v=#{cssVersion}" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="#{path.js}ybb/js/jquery.js?v=#{jsVersion}"></script>
<script type="text/javascript" src="#{path.js}ybb/js/form.js?v=#{jsVersion}"></script>
<script type="text/javascript" src="#{path.js}ybb/js/control.js?v=#{jsVersion}"></script>
<script type="text/javascript" language="JavaScript">
    var article_search_js_sid_err = "_{article_search_js_sid_err}";
	var article_search_js_searchkey_err = "_{article_search_js_searchkey_err}";
	var iframename = "#{iframename}";
	var digheight = "#{digheight}";
	$(document).ready(function(){
		var h = $(window).height();
		if(document.getElementById("mainbodybottonauto")){
			$('.managebottonadd').css({height:h-40});
		}
		var options = {
			beforeSubmit: formverify,
			success:function(){
				return false;
			}
		}
		$('#docsearch').submit(function() {
			$(this).ajaxSubmit(options);
			return false;
		});
	})

	function formverify(formData, jqForm, options) {
		var queryString = $.param(formData);
		var get=urlarray(queryString);
		if(get['searchkey']!=""){
			if(get['searchkey'].match(/[\'\"\<\>\,\;\^\$\(\)\!\.]+/ig)!=null) {
				document.docsearch.searchkey.focus();
				alert(article_search_js_searchkey_err);
				return false;
			}
		}
		if (get['mid']==0){
			document.docsearch.mid.focus();
			alert(article_search_js_sid_err);
			return false;
		}
		var esarchurl = "<%=link.to(new wojilu.Web.Controller.Admin.Qycms.ArticleController().ArticleList) %>?isbase=2&mid=" + get['mid'] + "&aid=&tid=" + get['tid']
			+"&sid="+get['sid']+"&isclass="+get['isclass']+"&islink="+get['islink']+"&ishtml="+get['ishtml']+"&ismess=&isorder="+get['isorder']
			+"&purview=&limitkey=&limitclass=&dlid="+get['dlid']+"&eqid=1&serchekey="+encodeURI(get['searchkey']);
		parent.frames[iframename].search(esarchurl)
		parent.closeifram();
		return false;
	}
	
	function searchoption(mid,title){
		var lng=document.docsearch.lng.value;
		selectlinkagelng('tid', '<%=link.to(new wojilu.Web.Controller.Admin.Qycms.ArticleController().SctypeList) %>?isbase=1&islinkd=1&optiontitle=' + title + '&mid=' + mid + '&lng=' + lng);
	    selectlinkagelng('sid', '<%=link.to(new wojilu.Web.Controller.Admin.Qycms.ArticleController().ScsubList) %>?optiontitle=' + title + '&mid=' + mid + '&lng=' + lng);
	    selectlinkagelng('dlidlist', '<%=link.to(new wojilu.Web.Controller.Admin.Qycms.ArticleController().DoclabelList) %>?mid=' + mid);
	}
</script>
</head>

<body style="background-color: #FFFFFF">
<form name="docsearch" id="docsearch" method="post" action="#body">
<input type="hidden" name="lng" id="lngtype" value="#{lng}" />
<div id="mainbodybottonauto" class="managebottonadd">
	<div class="maindobycontent">
		<div class="suggestion">
			<span class="sugicon"><span class="strong colorgorning2">_{position_title}</span><span class="padding-left5 colorgorningage">_{article_search_title}</span></span>
		</div>
		<div class="manageeditdiv">
			<div class="maneditcontent">
				<table class="formtablewin">
					<tr class="trstyle2">
						<td width="20%" class="trtitle01">_{article_search_keyword}</td>
						<td width="80%" class="trtitle02"><input type="text" name="searchkey" size="30" maxlength="30" class="infoInput"/></td>
					</tr>
					<tr class="trstyle2">
						<td width="20%" class="trtitle01">_{subjectmanage_type_add_mid}</td>
						<td width="80%" class="trtitle02">
							<select size="1" name="mid" id="mid" onchange="javascript:searchoption(this.value,'_{all_botton}')">
								<option value="0">_{subjectmanage_type_add_mid_option}</option>
                                <%var modelarray = v.data("modelarray") as List<Model>; %>
                                <%foreach(var row in  modelarray){%>
								<option <%if(row.Id== Convert.ToInt32(v.data("mid"))){ %>selected<%} %> value="<%=row.Id %>"><%=row.modelname %></option>
								<%} %>
							</select>
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="20%" class="trtitle01">_{article_doc_add_tid}</td>
						<td width="80%" class="trtitle02">
							<select size="1" name="tid" id="tid">
								<option value="0">_{all_botton}</option>
                                <%var list = v.data("list") as List<TypeList>; %>
								<%foreach(var row in list){ %>
								<option <%if (row.Id == Convert.ToInt32(v.data("tid"))) { %>selected<%} %> value="<%=row.Id %>"><%var str = string.Empty; %><%for (var i = 1; i < row.level + 1; i++) { %><%str += "&nbsp;&nbsp;&nbsp;&nbsp;"; %><%} %><%=str %>├─  <%=row.typename %></option>
								<%} %>
							</select>
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="20%" class="trtitle01">_{article_doc_add_sid}</td>
						<td width="80%" class="trtitle02">
							<select size="1" name="sid" id="sid">
								<option value="0">_{all_botton}</option>
                                <%var subjectlist = v.data("subjectlist") as List<SubjectList>; %>
								<%foreach(var row in subjectlist){ %>
								<option  value="<%=row.Id %>"><%=row.subjectname %></option>
								<%} %>
							</select>
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="20%" class="trtitle01">_{viewtype_botton}</td>
						<td width="80%" class="trtitle02">
							<span id="dlidlist">
								<input type="radio" value="0" checked="checked" name="dlid"/> _{all_botton}
                                <%var j = 0; %>
                                <%var doclabel = v.data("doclabel") as List<Document_Label>; %>
								<%foreach (var row in doclabel) { %>
                                <%j++; %>
								<input type="radio" name="dlid" value="<%=row.Id %>"/> <%=row.labelname %>&nbsp;
									<%if (j % 5 == 0){ %><br /><%} %>
								<%} %>
							</span>
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="20%" class="trtitle01">_{article_islink_botton}</td>
						<td width="80%" class="trtitle02">
							<input type="radio" value="0" name="islink" checked="checked"/> _{all_botton}&nbsp;
							<input type="radio" value="1" name="islink"/> _{open_botton_title}&nbsp;
							<input type="radio" value="2" name="islink"/> _{close_botton_title}
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="20%" class="trtitle01">_{article_ishtml_botton}</td>
						<td width="80%" class="trtitle02">
							<input type="radio" value="0" name="ishtml" checked="checked"/> _{all_botton}&nbsp;
							<input type="radio" value="1" name="ishtml"/> _{article_ishtml_botton_2}&nbsp;
							<input type="radio" value="2" name="ishtml"/> _{article_ishtml_botton_1}
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="20%" class="trtitle01">_{article_isorder_botton}</td>
						<td width="80%" class="trtitle02">
							<input type="radio" value="0" name="isorder" checked="checked"/> _{all_botton}&nbsp;
							<input type="radio" value="1" name="isorder"/> _{open_botton_title}&nbsp;
							<input type="radio" value="2" name="isorder"/> _{close_botton_title}
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="20%" class="trtitle01">_{lock_botton}</td>
						<td width="80%" class="trtitle02">
							<input type="radio" value="0" name="isclass" checked="checked"/> _{all_botton}&nbsp;
							<input type="radio" value="1" name="isclass"/> _{infook_botton}&nbsp;
							<input type="radio" value="2" name="isclass"/> _{lockok_botton}
						</td>
					</tr>
				</table>
			</div>
		</div>
	</div>
</div>
<div id="downbotton">
	<div id="subbotton">
			<table border="0" width="100%">
				<tr id="bottonsubmit">
					<td id="right"><input type="submit" name="Submit" id="submitbotton" value="_{botton_search}" class="buttonface" title="_{botton_search}"/></td>
					<td id="left" class="padding-left5"><input type="reset" name="reset" onClick="javascript:parent.closeifram();" id="release" value="_{botton_search_reset}" class="buttonface"  title="_{botton_search_reset}" /></td>
				</tr>
			</table>
		</div>
	</div>
</div>
</form>
</body>
</html>